# Maintainer: Leonidas Spyropoulos <artafinde@archlinux.org>

pkgname=pyflow
pkgver=0.3.1
pkgrel=1
pkgdesc="An installation and dependency system for Python"
arch=('loong64' 'x86_64')
url='https://github.com/David-OConnor/pyflow'
license=('MIT')
depends=('gcc-libs' 'bzip2' 'xz')
makedepends=('cargo')
options=('!lto')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/David-OConnor/pyflow/archive/refs/tags/${pkgver}.tar.gz)
b2sums=('218b27e1a375bf5f7e486b4ab5cb0b1b8a4fc0ce12a763e504abf12ebc7c4e28064960b63600b8a9fa4999a76da3fb7728fd1051268b9f859c8d5d793c262e37')

prepare() {
  cd "${pkgname}-${pkgver}"
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd "${pkgname}-${pkgver}"
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo build --release --frozen
}

check() {
  cd "${pkgname}-${pkgver}"
  export RUSTUP_TOOLCHAIN=stable
  cargo test --release --frozen -- --test-threads 1
}

package() {
  cd "${pkgname}-${pkgver}"
  install -Dm755 target/release/${pkgname} -t "${pkgdir}"/usr/bin
  install -Dm644 LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgname}
}

# vim:set ft=sh sw=2 sts=2 et:
